<!DOCTYPE html><html><head><title>Ext.data.validations | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
<style type="text/css">.head-band { display: none; }
.header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
.doc-tab .members .member a.more { background-color: #efefef; }
</style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
</head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
<a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">

    req = {
        liveURL: '.',
        standAloneMode: true,
        origDocClass: 'Ext.data.validations',
        docClass: 'Ext.data.validations',
        docReq: 'Ext.data.validations',
        version: '4.0',
        baseURL: '.',
        baseDocURL: '.',
        baseProdURL: '.'
    };

    clsInfo = {};



</script>

<script type="text/javascript" src="../search.js"></script>
<!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
<script type="text/javascript" src="../class_tree.js"></script>
<script type="text/javascript" src="../class_doc.js"></script>
<script type="text/javascript">
    req.source = 'validations.html#Ext-data.validations';
    clsInfo = {"methods":["exclusion","format","inclusion","length","presence"],"cfgs":[],"properties":["exclusionMessage","formatMessage","inclusionMessage","lengthMessage","presenceMessage"],"events":[],"subclasses":[]};
    Ext.onReady(function() {
        Ext.create('Docs.classPanel');
    });
</script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/validations.html#Ext-data.validations" target="_blank">Ext.data.validations</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><p>This singleton contains a set of validation functions that can be used to validate any type
of data. They are most often used in <a href="Ext.data.Model.html" rel="Ext.data.Model" class="docClass">Models</a>, where they are automatically
set up and executed.</p>

<div class="members"><div class="m-properties"><a name="properties"></a><div class="definedBy">Defined By</div><h3 class="prp p">Properties</h3><div id="property-exclusionMessage" class="member f ni"><a href="Ext.data.validations.html#property-exclusionMessage" rel="property-exclusionMessage" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-property-exclusionMessage" class="viewSource">view source</a></div><a name="exclusionMessage"></a><a name="property-exclusionMessage"></a><a href="Ext.data.validations.html#" rel="property-exclusionMessage" class="cls expand">exclusionMessage</a><span> : String</span></div><div class="description"><div class="short"><p>The default error message used when an exclusion validation fails</p>
</div><div class="long"><p>The default error message used when an exclusion validation fails</p>
</div></div></div><div id="property-formatMessage" class="member ni"><a href="Ext.data.validations.html#property-formatMessage" rel="property-formatMessage" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-property-formatMessage" class="viewSource">view source</a></div><a name="formatMessage"></a><a name="property-formatMessage"></a><a href="Ext.data.validations.html#" rel="property-formatMessage" class="cls expand">formatMessage</a><span> : Boolean</span></div><div class="description"><div class="short"><p>The default error message used when a format validation fails</p>
</div><div class="long"><p>The default error message used when a format validation fails</p>
</div></div></div><div id="property-inclusionMessage" class="member ni"><a href="Ext.data.validations.html#property-inclusionMessage" rel="property-inclusionMessage" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-property-inclusionMessage" class="viewSource">view source</a></div><a name="inclusionMessage"></a><a name="property-inclusionMessage"></a><a href="Ext.data.validations.html#" rel="property-inclusionMessage" class="cls expand">inclusionMessage</a><span> : String</span></div><div class="description"><div class="short"><p>The default error message used when an inclusion validation fails</p>
</div><div class="long"><p>The default error message used when an inclusion validation fails</p>
</div></div></div><div id="property-lengthMessage" class="member ni"><a href="Ext.data.validations.html#property-lengthMessage" rel="property-lengthMessage" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-property-lengthMessage" class="viewSource">view source</a></div><a name="lengthMessage"></a><a name="property-lengthMessage"></a><a href="Ext.data.validations.html#" rel="property-lengthMessage" class="cls expand">lengthMessage</a><span> : String</span></div><div class="description"><div class="short"><p>The default error message used when a length validation fails</p>
</div><div class="long"><p>The default error message used when a length validation fails</p>
</div></div></div><div id="property-presenceMessage" class="member ni"><a href="Ext.data.validations.html#property-presenceMessage" rel="property-presenceMessage" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-property-presenceMessage" class="viewSource">view source</a></div><a name="presenceMessage"></a><a name="property-presenceMessage"></a><a href="Ext.data.validations.html#" rel="property-presenceMessage" class="cls expand">presenceMessage</a><span> : String</span></div><div class="description"><div class="short"><p>The default error message used when a presence validation fails</p>
</div><div class="long"><p>The default error message used when a presence validation fails</p>
</div></div></div></div><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-exclusion" class="member f ni"><a href="Ext.data.validations.html#method-exclusion" rel="method-exclusion" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-method-exclusion" class="viewSource">view source</a></div><a name="exclusion"></a><a name="method-exclusion"></a><a href="Ext.data.validations.html#" rel="method-exclusion" class="cls expand">exclusion</a>(
<span class="pre">Object config, String value</span>)
 : Boolean</div><div class="description"><div class="short"><p>Validates that the given value is present in the configured <a href="Ext.data.validations.html#list" rel="Ext.data.validations#list" class="docClass">list</a></p>
</div><div class="long"><p>Validates that the given value is present in the configured <a href="Ext.data.validations.html#list" rel="Ext.data.validations#list" class="docClass">list</a></p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">config</span> : Object<div class="sub-desc"><p>Optional config object</p>
</div></li><li><span class="pre">value</span> : String<div class="sub-desc"><p>The value to validate</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>True if the value is not present in the list</p>
</li></ul></div></div></div><div id="method-format" class="member ni"><a href="Ext.data.validations.html#method-format" rel="method-format" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-method-format" class="viewSource">view source</a></div><a name="format"></a><a name="method-format"></a><a href="Ext.data.validations.html#" rel="method-format" class="cls expand">format</a>(
<span class="pre">Object config, String value</span>)
 : Boolean</div><div class="description"><div class="short"><p>Returns true if the given value passes validation against the configured <a href="Ext.data.validations.html#matcher" rel="Ext.data.validations#matcher" class="docClass">matcher</a> regex</p>
</div><div class="long"><p>Returns true if the given value passes validation against the configured <a href="Ext.data.validations.html#matcher" rel="Ext.data.validations#matcher" class="docClass">matcher</a> regex</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">config</span> : Object<div class="sub-desc"><p>Optional config object</p>
</div></li><li><span class="pre">value</span> : String<div class="sub-desc"><p>The value to validate</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>True if the value passes the format validation</p>
</li></ul></div></div></div><div id="method-inclusion" class="member ni"><a href="Ext.data.validations.html#method-inclusion" rel="method-inclusion" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-method-inclusion" class="viewSource">view source</a></div><a name="inclusion"></a><a name="method-inclusion"></a><a href="Ext.data.validations.html#" rel="method-inclusion" class="cls expand">inclusion</a>(
<span class="pre">String value, Object value</span>)
 : Boolean</div><div class="description"><div class="short"><p>Validates that the given value is present in the configured <a href="Ext.data.validations.html#list" rel="Ext.data.validations#list" class="docClass">list</a></p>
</div><div class="long"><p>Validates that the given value is present in the configured <a href="Ext.data.validations.html#list" rel="Ext.data.validations#list" class="docClass">list</a></p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">value</span> : String<div class="sub-desc"><p>The value to validate</p>
</div></li><li><span class="pre">value</span> : Object<div class="sub-desc">
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>True if the value is present in the list</p>
</li></ul></div></div></div><div id="method-length" class="member ni"><a href="Ext.data.validations.html#method-length" rel="method-length" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-method-length" class="viewSource">view source</a></div><a name="length"></a><a name="method-length"></a><a href="Ext.data.validations.html#" rel="method-length" class="cls expand">length</a>(
<span class="pre">Object config, String value</span>)
 : Boolean</div><div class="description"><div class="short"><p>Returns true if the given value is between the configured min and max values</p>
</div><div class="long"><p>Returns true if the given value is between the configured min and max values</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">config</span> : Object<div class="sub-desc"><p>Optional config object</p>
</div></li><li><span class="pre">value</span> : String<div class="sub-desc"><p>The value to validate</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>True if the value passes validation</p>
</li></ul></div></div></div><div id="method-presence" class="member ni"><a href="Ext.data.validations.html#method-presence" rel="method-presence" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.validations.html" class="definedIn docClass">Ext.data.validations</a><br/><a href="../source/validations.html#Ext-data.validations-method-presence" class="viewSource">view source</a></div><a name="presence"></a><a name="method-presence"></a><a href="Ext.data.validations.html#" rel="method-presence" class="cls expand">presence</a>(
<span class="pre">Object config, Mixed value</span>)
 : Boolean</div><div class="description"><div class="short"><p>Validates that the given value is present</p>
</div><div class="long"><p>Validates that the given value is present</p>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">config</span> : Object<div class="sub-desc"><p>Optional config object</p>
</div></li><li><span class="pre">value</span> : Mixed<div class="sub-desc"><p>The value to validate</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>True if validation passed</p>
</li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>